/*
 * @Author: 飞越疯人院 353362604@qq.com
 * @Date: 2022-10-13 08:30:36
 * @LastEditors: 飞越疯人院 353362604@qq.com
 * @LastEditTime: 2023-01-09 17:54:41
 * @FilePath: \adminstration\src\Common\Modal\TwoModalList\Organization.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { API_LIST } from '../../Api/Api'
import { commonTableList } from '../config'
import { TwoAddBtn, ThrDeleteBtn } from '../options'

export const ProjectSetUpPayment = async ({ upDataEvent, data, Permission }) => {
    let dataList = {
        type: '项目付费测算情况列表',
        hideInSearch: true,
        pageSize: 10,
        params: {},
        classification: 'TableModal',
        get: API_LIST()['getProjectPayment'],
        additional: { key: 'organizationUuid', value: 'uuid' },
        options: [
            Permission.findIndex(v => v.uuid === '8f3702ea-7d43-4869-ab5a-a63337e93a4d') !== -1 && (
                <TwoAddBtn
                    upDataEvent={upDataEvent}
                    title="添加"
                    ThrKey="ThrModal"
                    value="ProjectSetUpPayment"
                    data={data}
                />
            ),
        ],
        columns: [
            { ...commonTableList.tableName, title: '名称' },
            {
                dataIndex: 'yearMonth',
                title: '年月',
                valueType: 'Date',
                picker: 'month',
                rules: true,
                width: 150,
            },
            {
                dataIndex: 'amount',
                title: '金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'lateAmount',
                title: '滞纳金',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 220,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        Permission.findIndex(v => v.uuid === '63576846-0bfd-4826-b02d-91e029965c97') !== -1 && (
                            <ThrDeleteBtn
                                key="delete"
                                record={record.uuid}
                                upDataEvent={upDataEvent}
                                data={{ key: 'delete', url: 'delProjectPayment', title: '删除' }}
                            />
                        ),
                    ]
                },
            },
        ],
    }
    return dataList
}
